package com.huawei.control.phonesinfo;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.huawei.model.PhoneInfoModel;
import com.huawei.model.UserInfoModel;
import com.huawei.utils.EasyFactory;

@WebServlet("/PhonesInfoAjaxDeleteControl")
public class PhonesInfoAjaxDeleteControl extends HttpServlet {
	private static final long serialVersionUID = 1L;

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// 从request中获取id主键值
		String p_id = request.getParameter("pid");
		// 调用model层进行删除业务逻辑操作
		int i = EasyFactory.getNewInstance(PhoneInfoModel.class).deletePhoneInfoById(p_id);
		// 显示数据,使用转发或者是重定向跳转到另外一个Control进行后台处理
		// 使用转发跳转到另外一个Control进行后台处理
		response.sendRedirect("PhonesInfoAjaxQueryControl?flag=1");
	}   
}
